package bancosys.tec.persist.entities.dao;

import org.hibernate.Criteria;
import org.hibernate.criterion.Restrictions;

import bancosys.tec.persist.dao.BaseDAO;
import bancosys.tec.persist.dao.BeanNotFoundException;
import bancosys.tec.persist.entities.domain.Pai;

/**
 * @created 11.07.2007
 * @author Gustavo Almeida
 */
public class PaiDAO extends BaseDAO<Pai> {
    // empty

    public Pai findByName(String name) throws BeanNotFoundException {
        Criteria crit = this.getSession().createCriteria(Pai.class);
        crit.add(Restrictions.eq("name", name));
        return this.executeSingleQuery(crit);
    }
}